#ifndef __EMB_MEM_H
#define __EMB_MEM_H

#include "emb.h"



#define EMB_CONF_MEM_DEBUG_ENABLE 1

typedef struct{
    uint8_t *Start;
    uint16_t Used;
    #if EMB_CONF_MEM_DEBUG_ENABLE>0
    uint16_t Size;
    #endif
} emb_mem_ctrl_t;

void emb_mem_init(emb_mem_ctrl_t *Ctrl,uint8_t* Buf,uint16_t BufSize);

void* emb_mem_alloc(emb_mem_ctrl_t *Ctrl,size_t Size);

void emb_mem_free(emb_mem_ctrl_t *Ctrl);



#endif

